Skip to content

docs: fix outdated content across docs/ and root-level docs/scripts#6662

Open
Little-Peony wants to merge 9 commits intotronprotocol:developfrom
Little-Peony:clean_docs
Open

docs: fix outdated content across docs/ and root-level docs/scripts#6662
Little-Peony wants to merge 9 commits intotronprotocol:developfrom
Little-Peony:clean_docs

Conversation

@Little-Peony
Copy link
Copy Markdown

@Little-Peony Little-Peony commented Apr 9, 2026

Summary

Documentation and script cleanup. No production code modified.

docs/ — six files under docs/

implement-a-customized-actuator (EN + ZH)

  • SumContract field number: 5260 (52 is already taken by MarketSellAssetContract)
  • Missing proto import: add import "core/contract/math_contract.proto" to api.proto
  • Missing static import: add import static org.tron.core.config.Parameter.ChainConstant.TRANSFER_FEE
  • Test lifecycle: @Before/@After@BeforeClass/@AfterClass
  • Args initialization order: Args.setParam() must be called before Args.getInstance()
  • Hardcoded "output-directory"@ClassRule TemporaryFolder
  • Non-existent API: replace addService()/initServices()/startServices()/shutdownServices() with startup() / shutdown()
  • Auto-registration note: TransactionRegister.registerActuator() scans org.tron.core.actuator at startup via Reflections — no manual registration needed
  • Removed pinned protoc v3.4.0 note; added @Rule Timeout

modular-deployment (EN + ZH)

  • Removed stale "will be deprecated" claim for java -jar FullNode.jar
  • Removed Windows *.bat references (Windows is not supported per README)
  • Replaced CMS GC flags (-XX:+UseConcMarkSweepGC etc.) removed in JDK 14 with JDK 8/17-compatible options

modular-introduction (EN + ZH)

  • Updated module count from six to eight; added crypto and plugins descriptions

Root-level docs and scripts

gen.sh

  • Added shebang; fixed proto paths to protocol/src/main/protos/; added required -I include flags; split into two invocations (core + api) for correct import resolution; set output to protocol/src/main/java

build.md

  • Rewrote with current JDK matrix (JDK 8 for x86_64, JDK 17 for ARM64); removed Oracle JDK requirement and Ubuntu 16.04 references; deduplicated prerequisites/clone/build sections with links to README

run.md

  • Rewrote to remove dead links, fix SR node private key (must go in config, not -p CLI flag), remove non-existent gradlew run -Pwitness task and 2018-era log output

quickstart.md

  • Removed deprecated Solidity Node port 8091 and related references; marked docker-tron-quickstart as community-maintained

CONTRIBUTING.md

  • Replace Travis CI with GitHub Actions; fix commit title length guidance from 50 to 10–72 chars to match the PR Title Format section

start.sh

  • Fixed always-false if $darwinif [[ "$(uname)" == "Darwin" ]]
  • Replaced $(`echo fn`) anti-pattern with $(fn) at 8 call sites
  • Replaced removed CMS GC flags with G1GC
  • Fixed always-true ALL_OPT_LENGTH -eq 0 || -gt 0 and duplicate restart call

ver.sh

  • Removed set -x debug mode; fixed Version.java path to framework/src/main/java/org/tron/program/Version.java

Test plan

  • Verify all docs render correctly in Markdown
  • Confirm SumContract = 60 does not conflict with any existing ContractType value in Tron.proto
  • Confirm proto compiler accepts the updated api.proto with the new import
  • Confirm JVM starts without errors using the updated GC flags on JDK 8 and JDK 17
  • Confirm gen.sh compiles protos successfully from project root
  • Confirm start.sh syntax check passes (bash -n start.sh)

🤖 Generated with Claude Code

Little-Peony and others added 5 commits April 9, 2026 10:29
implement-a-customized-actuator (EN+ZH):
- Fix test lifecycle: @Before/@after → @BeforeClass/@afterclass so the
  Spring context is created only once per test class, not per test method
- Fix Args initialization order: Args.setParam() must be called before
  Args.getInstance() to avoid passing a stale unconfigured instance to
  appTest.initServices()
- Replace hardcoded dbPath with @ClassRule TemporaryFolder to keep
  test directories isolated and auto-cleaned
- Add @rule Timeout to guard against hangs
- Remove the specific protoc v3.4.0 version note; point readers to the
  version declared in build.gradle instead

modular-deployment (EN+ZH):
- Replace CMS GC flags (-XX:+UseConcMarkSweepGC, -XX:+CMSParallelRemarkEnabled,
  -XX:+CMSScavengeBeforeRemark) that were removed in JDK 14 and would
  cause startup failures on JDK 17 (required for ARM64)
- Add -Xms/-Xmx to the example and note JDK 8/17 compatibility

modular-introduction (EN+ZH):
- Update module count from six to eight
- Add descriptions for the crypto and plugins modules

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
implement-a-customized-actuator (EN+ZH):
- SumContract field number: 52 is already taken by MarketSellAssetContract;
  change to 60 (next available number after CancelAllUnfreezeV2Contract=59)
- SumActuator: add missing static import for TRANSFER_FEE from
  Parameter.ChainConstant (not inherited from AbstractActuator)
- SumActuatorTest: Application does not have addService()/initServices()/
  startServices()/shutdownServices(); replace with startup()/shutdown()
  which are the actual API methods

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
implement-a-customized-actuator (EN+ZH):
- Add the missing 'import "core/contract/math_contract.proto"' step in
  api.proto; without it the proto compiler cannot resolve SumContract in
  the InvokeSum RPC definition (compile failure)
- Add a note explaining that SumActuator must live in org.tron.core.actuator:
  TransactionRegister.registerActuator() uses Reflections to scan that
  package at startup and auto-registers every AbstractActuator subclass
  via the super() constructor call into TransactionFactory

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…t guide

modular-deployment (EN+ZH):
- Remove 'will be deprecated' note for java -jar FullNode.jar: README
  shows it as a fully supported launch method alongside the script
- Add explicit platform note: Linux and macOS only, Windows not supported
- Remove '*.bat on Windows' startup instruction: Windows is not supported
  per README line 39

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- start.sh: fix always-false `if $darwin` → `if [[ "$(uname)" == "Darwin" ]]`
- start.sh: replace `$(\`echo fn\`)` anti-pattern with `$(fn)` in 8 call sites
- start.sh: replace removed CMS GC flags with G1GC
- start.sh: fix always-true `ALL_OPT_LENGTH -eq 0 || -gt 0` and duplicate restart
- ver.sh: remove `set -x` debug mode left in by mistake
- ver.sh: fix Version.java path to framework/src/main/java/org/tron/program/Version.java

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Little-Peony and others added 2 commits April 13, 2026 10:39
- gen.sh: fix proto paths, add shebang and -I include flags, split core/api
- build.md: rewrite with current JDK matrix; deduplicate vs README via links
- run.md: rewrite to remove dead links, fix SR private key security issue,
  remove gradle run -Pwitness and 2018-era log output
- quickstart.md: remove deprecated Solidity Node port/references; mark
  docker-tron-quickstart as community-maintained
- CONTRIBUTING.md: replace Travis CI with GitHub Actions; fix commit
  title length from 50 to 10-72 chars to match PR Title Format section

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Little-Peony Little-Peony changed the title docs: fix outdated content in deployment and actuator tutorial docs docs: fix outdated content across docs/ and root-level docs/scripts Apr 13, 2026
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
![modular-structure](https://github.com/tronprotocol/java-tron/blob/develop/docs/images/module.png)

A modularized java-tron consists of six modules: framework, protocol, common, chainbase, consensus and actuator. The function of each module is elaborated below.
A modularized java-tron consists of eight modules: framework, protocol, common, chainbase, consensus, actuator, crypto and plugins. The function of each module is elaborated below.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The module count should be nine, not eight — platform is missing. From settings.gradle:

framework, chainbase, protocol, actuator, consensus, common, crypto, plugins, platform

Please add a description for the platform module and update the count in both EN and ZH files.

@@ -1,81 +1,54 @@
# How to Build
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After the rewrite, both build.md and run.md are mostly thin wrappers that point back to the README. Maintaining multiple files that say "see README" adds indirection for readers and maintenance burden (they can easily drift out of sync again — which is how they got stale in the first place).

Suggestion: consider removing build.md and run.md entirely, and moving the unique content (IntelliJ IDEA setup steps, jitpack dependency snippet) into the README or a CONTRIBUTING.md section. This would be a net reduction in maintenance surface.

@317787106
Copy link
Copy Markdown
Collaborator

Suggest to delete build.md, gen.sh, run.md and some unused file totally, specify the alternative document in README.md. There are too many reduant files in root level.

@halibobo1205
Copy link
Copy Markdown
Collaborator

The PR title and commits are scoped to docs:, but the changeset also modifies shell scripts (start.sh, ver.sh, gen.sh) with functional bug fixes (e.g., undefined $darwin variable, tautological condition, CMS→G1GC). Consider either splitting into two PRs (docs vs. scripts) or updating the title/scope to reflect the actual changes, e.g., docs, chore(scripts): ....



versionPath="src/main/java/org/tron/program/Version.java"
versionPath="framework/src/main/java/org/tron/program/Version.java"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ver.sh has two invocation paths:

  1. Direct execution from the repo root: ./ver.sh — the new path framework/src/main/java/... resolves correctly.
  2. Via Gradle: ./gradlew version — the task is defined in framework/build.gradle with commandLine 'bash', '-c', '../ver.sh', so the working directory is framework/. The new path resolves to framework/framework/src/main/java/.../Version.java, which does not exist:
 warning: could not open directory 'framework/framework/src/main/java/org/tron/program/': No such file or directory
fatal: pathspec 'framework/src/main/java/org/tron/program/Version.java' did not match any files

The original relative path src/main/java/... was actually correct for the Gradle invocation.

Suggestion: add cd "$(dirname "$0")" at the top of ver.sh to anchor the working directory to the script's location (i.e., the repo root), so both invocation paths work correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants